<?php

    $api_key = 'NO_INCLUIDA';

    $api_url = 'http://tinysong.com/';
    
    $limit = 5;
  
    // build URL
    $url = $api_url . 's/' . $_GET['cancion'] .'+'.  $_GET['artista'] . '?format=json&limit=' . (int) $limit . '&key=' . $api_key;

    // initiate CURL
    $ch = curl_init();

    // CURL options
    curl_setopt( $ch, CURLOPT_HEADER, 0);
    curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_URL, $url);

    $output = curl_exec($ch);

    curl_close ($ch);

    $response = $output;

	echo $response;
	
?>
